package com.xucan.mapperstruct.listsource;

import java.util.Arrays;
import java.util.List;

public class Main {
    public static void main(String[] args) {
        // 创建源对象列表
        Source source1 = new Source("Alice", 25);
        Source source2 = new Source("Bob", 30);
        List<Source> sourceList = Arrays.asList(source1, source2);

        // 进行集合映射
        List<Target> targetList = SourceTargetMapper.INSTANCE.sourcesToTargets(sourceList);

        // 输出映射结果
        for (Target target : targetList) {
            System.out.println("Name: " + target.getName() + ", Age: " + target.getAge());
        }
    }
}